#include<stdio.h>
#define M 3
#define N 2
struct student{
	long xh;
	char xm[128];
	int cj[N];
	int zf;	
	double ave;
};
void input(struct student a[])
{
	struct student *p;
	int i;
	double sum; 
	for(p=a;p<a+M;p++)
	{
		scanf("%d%s%d%d",p->xh,p->xm,p->)
		sum=0;
		scanf("%ld\n",&p->xh);
		gets(p->xm);
		for(i=0;i<N;i++)
		{
			scanf("%d",&p->cj[i]);
			sum=sum+p->cj[i];
		}
		p->zf=sum;	
		p->ave=sum/N;	
	}
}
void output(struct student a[])
{
	struct student m;
	struct student *p;
	int i;
	m=a[0];
	for(p=a+1;p<a+M;p++)
	{
		if(p->zf>m.zf)
		{
			m=*p;
		}
	}
	for(p=a;p<a+M;p++)
	{
		printf("%ld,%s,",p->xh,p->xm);
		for(i=0;i<N;i++)
		{
			printf("%d,",p->cj[i]);
		}
		printf("%.2lf\n",p->ave);
	}
	printf("%ld,%s,",m.xh,m.xm);
	for(i=0;i<N;i++)
	{
		printf("%d,",m.cj[i]);
	}
	printf("%.2lf",m.ave);	
}
int main()
{
	struct student a[M];
	input(a);
	output(a);
return 0;	
}
